package com.symbio.ishenapi.patient.controller;



import com.symbio.ishenapi.common.controller.BaseController;
import io.jboot.web.controller.annotation.RequestMapping;

@RequestMapping("/P_D")
public class BoundPatientDoctor extends BaseController {

    /**
     * wy:接口已经移动到后台
     */
   /* public void BindingPD(){    //绑定医生
        TmPatientDoctor tpd = (TmPatientDoctor) getReqBodyObject(TmPatientDoctor.class);
        if("".equals(tpd.getUserId()) || tpd.getUserId()==null){

            renderJsonError(40003,"userId");
            return;
        }else if("".equals(tpd.getDoctorId()) || tpd.getDoctorId()==null){
            renderJsonError(40003,"doctorId");
            return;
        }
        int num=TmPatientDoctor.dao.getUserCountById(tpd);
        if(num>=1){
            renderJsonError(40011,"该用户与所绑定医生");
            return;
        }
        tpd.set("createTime", new Date());
        if(tpd.save()){///绑定成功返回成功信息
            renderJsonRet(tpd.getDoctorId());
        }else{////绑定失败
            renderJsonError(40002,"关注医生信息");
        }
    }*/

    /**
     * wy:已经移动到后台
     */
/*    public void findP_D(){      //查看关联医生
        System.out.println("进来");
        //renderText("abc");
        BigInteger userId = new BigInteger(getPara("userId"), 10);
        System.out.println("获取到的用户ID为"+userId);
        List<AttentionDoctorBean> result = TmPatientDoctor.dao.findTmPatientDoctorList(userId);
        renderJson(result.get(0));
    }*/

    /**
     *关注医生管理
     *批量删除医生
     */
   /* public void delBatchDoctor(){
        TmPatientUser user = (TmPatientUser) getReqBodyObject(TmPatientUser.class);
        String[] DoctorId = user.getUserDoctorId().split(",");
        for(int i=0;i<DoctorId.length;i++){
            user.setUserDoctorId(DoctorId[i]);
            int b = TmPatientDoctor.dao.delDoctor(user);
            if(b>0){///绑定成功返回成功信息
                renderJsonRet(b);
            }else{////绑定失败
                renderJsonError(40013,"请重试!");
            }
        }
    }*/

    /**
     *关注医生管理
     *删除医生
     */
    /*public void delDoctor(){
        TmPatientUser user = (TmPatientUser) getReqBodyObject(TmPatientUser.class);
        int b = TmPatientDoctor.dao.delDoctor(user);
        if(b>0){///绑定成功返回成功信息
            renderJsonRet(b);
        }else{////绑定失败
            renderJsonError(40013,"请重试!");
        }
    }*/

    /**
     *关注医生管理
     *显示医生列表
     */
   /* public void findDoctorList(){
        TmPatientUser user = (TmPatientUser) getReqBodyObject(TmPatientUser.class);
        TmPatientDoctor.dao.findDoctorList(user);
    }*/
}
